////////////////////////////////////////////////////////////////////////////
//
//  Crytek Engine Source File.
//  Copyright (C), Crytek Studios, 2002.
// -------------------------------------------------------------------------
//  File name:   terrainpainterpanel.h
//  Version:     v1.00
//  Created:     25/10/2002 by Timur.
//  Compilers:   Visual Studio.NET
//  Description: 
// -------------------------------------------------------------------------
//  History:
//
////////////////////////////////////////////////////////////////////////////

#ifndef __terrainpainterpanel_h__
#define __terrainpainterpanel_h__

#if _MSC_VER > 1000
#pragma once
#endif


#include "Controls/ColorPickerButton.h"
#include "Controls/SliderCtrlEx.h"

struct CTextureBrush;
class CLayer;

/////////////////////////////////////////////////////////////////////////////
// CTerrainPainterPanel dialog
class CTerrainTexturePainter;

class CTerrainPainterPanel : public CXTResizeDialog, public IEditorNotifyListener
{
// Construction
public:
	CTerrainPainterPanel( CTerrainTexturePainter *tool,CWnd* pParent = NULL);   // standard constructor
	virtual ~CTerrainPainterPanel();

// Dialog Data
	//{{AFX_DATA(CTerrainPainterPanel)
	enum { IDD = IDD_PANEL_TERRAIN_LAYER };
	CComboBox	m_MaskLayerId;
	CSliderCtrlCustomDraw	m_hardnessSlider;
	CSliderCtrlCustomDraw	m_heightSlider;
	CSliderCtrlCustomDraw	m_BrightnessSlider;
	CListBox m_layers;
	//}}AFX_DATA

	void SetBrush( CTextureBrush &brush );
	CLayer* GetSelectedLayer();
	// Arguments:
	//   pLayer - can be 0 to deselect layer
	void SelectLayer( const CLayer *pLayer );

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CTerrainPainterPanel)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

	virtual void OnEditorNotifyEvent( EEditorNotifyEvent event );

// Implementation
protected:
	virtual void OnOK() {};
	virtual void OnCancel() {};

	void ReloadLayers();

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnHScroll( UINT nSBCode,UINT nPos,CScrollBar* pScrollBar );
	afx_msg void UpdateTextureBrushSettings();
	afx_msg void OnBrushResetBrightness();
	afx_msg void SetLayerMaskSettingsToLayer();
	afx_msg void GetLayerMaskSettingsFromLayer();
	afx_msg void OnBnClickedBrushSettolayer();

	DECLARE_MESSAGE_MAP()

	CNumberCtrl m_brushRadius;
	CNumberCtrl m_brushHardness;
	CTerrainTexturePainter*	m_tool;
	CCustomButton m_optDetailLayer;
	CCustomButton m_MaskLayerSettings;
	CColorPickerButton m_SolidColor;
	CSliderCtrlCustomDraw	m_radiusSlider;

	CCustomButton m_ApplyButton;
	CCustomButton m_ResetButton;

	CNumberCtrl m_layerAltMin;
	CNumberCtrl m_layerAltMax;
	CNumberCtrl m_layerSlopeMin;
	CNumberCtrl m_layerSlopeMax;

	bool m_bIgnoreNotify;
};

#endif // __terrainpainterpanel_h__
